package com.tao.power.Dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Boolean success;
    private String message;
    private Object data;
    private Long total;
    private int code;

    public static Result ok(String message,int code){
        return new Result(true, message,null,null, code);
    }
    public static Result ok(String message,Object data,int code){
        return new Result(true, message,data, null,code);
    }
    public static Result ok(String message,List<?> data, Long total,int code){
        return new Result(true, message, data, total,code);
    }
    public static Result fail(String message,int code){
        return new Result(false, message, null, null,code);
    }
}